/******************************************************************
******** 
 * ++ 
 * Author:    Team 1
 * Module Name  :  BasicRule.h
 * 
 * Description  : Source file for class BasicRule
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
 *                
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
 * 
 * Mod. History :  18.06.13 - Nguyen Khac Trung
 *                            File first created 
 *                            MP PROJECT 
 *							  The class responsibility for checking rules
 * -- 
 
*******************************************************************
*****/

#pragma once
#ifndef BASICRULE_H
#define BASICRULE_H

//File header
#include <ObjIdl.h>
#include <gdiplus.h>
#include <atlbase.h>
#include <string.h>
#include <string>
#include <list>
#include <stdlib.h>
#include <vector>

//Include files
#include "ChessPiece.h"
#include "Board.h"
#include "stdafx.h"


using namespace std;

class BasicRule 
{
	
	//
	static list<string> m_pListLog;
	//
	static Board* m_pBoard;
	//
	static ChessPiece* m_pRedKing;
	//
	static ChessPiece* m_pBlackKing;
public:
	//
	
	//
	BasicRule();
	//
	~BasicRule();
	//
	static bool IsKingBeingChecked(bool IsRedMove);
	//
	static bool IsKingFaceKing();
	//
	static void SetBoard(Board* _board);
	//
	static void SetListLog(list<string> _listLog);
	//
	static void SetRedKing(ChessPiece* redKing);
	//
	static void SetBlackKing(ChessPiece* blackKing);
	//
	static bool IsInsidePalace(POINT pos);
	//
	static bool HasSameColumnAs(POINT pos1, POINT pos2);
	//
	static bool CanElephantMoveTo(POINT currPos, POINT newPos);
	//
	static bool CanChariotMoveTo(POINT currPos, POINT newPos);
	//
	static bool CanAdvisorMoveTo(POINT currPos, POINT newPos);
	//
	static bool CanCannonMoveTo(POINT currPos, POINT newPos);
	//
	static bool CanGeneralMoveTo(POINT currPos, POINT newPos);
	//
	static bool CanHorseMoveTo(POINT currPos, POINT newPos);
	//
	static bool CanSoldierMoveTo(POINT currPos, POINT newPos, bool isRed);
	//
	static void WriteChariotTurn(HWND hListBox,bool isRedSide, POINT currPos, POINT newPos);
	static void CanChariotMoveAuto();

	static int CountNumberPieceSameTypeInColumn(char* nameclass, int col);

	//static void
};
#endif;